<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    public function up()
    {
        Schema::create('landing_companies', function (Blueprint $table) {
            $table->id();
            $table->string('name', 200)->unique()->comment('落地公司名称');
            $table->string('short_name', 100)->nullable()->comment('简称');
            $table->string('code', 50)->unique()->comment('公司代码');
            $table->string('tax_number', 50)->nullable()->comment('税号');
            $table->string('address', 500)->nullable()->comment('公司地址');
            $table->string('contact_person', 50)->nullable()->comment('联系人');
            $table->string('phone', 20)->nullable()->comment('电话');
            $table->string('email', 100)->nullable()->comment('邮箱');
            $table->enum('status', ['active', 'inactive'])->default('active')->comment('状态：active-启用，inactive-停用');
            $table->json('billing_categories')->nullable()->comment('开票类目数组');
            $table->text('remark')->nullable()->comment('备注');
            $table->timestamps();
        });
    }

    public function down()
    {
        Schema::dropIfExists('landing_companies');
    }
};